#[warn(unused_mut)]
fn main() {
    //bool
    let is_true: bool = true;
    let is_false: bool = false;
    println!("is_true = {}", is_true);
    println!("is_false = {}", is_false);

    // char in rust is 32bit
    let char_a = 'a';
    let char_you = '你';
    println!("char_a = {}", char_a);
    println!("char_you = {}", char_you);
    // i8,i16,i32,i64
    // u8, u16,u32,u64
    // f32,f64
    let num_u8: u8 = 14;
    let num_i8: i8 = -111;
    let num_f32: f32 = 0.99;

    //  自适应类型 isize, usize
    println!("max_usize = {}", usize::max_value());
    println!("max_isize = {}", isize::max_value());

    // array, [Type; size]
    let arr1: [u32; 5] = [1, 2, 3, 4, 5];
    let arr2: [u32; 3] = [3, 4, 5];
    println!("arr1[0] = {}", arr1[0]);
    show(arr2);

    // tuple
    println!("+++++tuple+++++");
    let tup: (i32, f32, char) = (-3, 3.14, '好');
    println!("tup.0 = {}", tup.0);
    println!("tup.1 = {}", tup.1);
    println!("tup.2 = {}", tup.2);
    
    let (x, y, z) = tup;
    println!("x = {}", x);
    println!("y = {}", y);
    println!("z = {}", z);

    println!("Hello, world!");
}

fn show(arr: [u32; 3]) {
    println!("++++++array+++++");
    for i in &arr {
        println!("{}", i);
    }
}